package com.spring.sd;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Bean 的生命周期
 */
@SpringBootApplication(scanBasePackages = "com.spring.sd.bean")
public class BeanLifeCycle {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(BeanLifeCycle.class, args);
        // 调用 close 方法，显示生命周期的销毁阶段
        context.close();
    }
}
